package com.senditcertified.mail;

import org.json.JSONObject;

import com.Utility.Utility;
import com.activities.SecureActivity;
import com.parser.Error_Report;
import com.parser.Parser_Soap;
import com.soap.call.Http_Soap_Call;
import com.senditcertified.mail.R;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

public class Attachment extends Activity implements OnClickListener {
	/**
	 * @see android.app.Activity#onCreate(Bundle)
	 */
	ProgressDialog pd;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		// TODO Put your code here
		setContentView(R.layout.attachment);

		ImageView file_1_download, file_2_download, file_3_download, file_4_dwonload, file_5_download, file_6_dwonload, file_7_download, file_8_download, file_9_download, file_10_download;

		Button file_1_Vault, file_2_vault, file_3_vault, file_4_vault, file_5_vault, file_6_vault, file_7_valut, file_8_vault, file_9_valut, file_10_vault;

		file_1_download = (ImageView) findViewById(R.id.file_1_download);
		file_1_download.setOnClickListener(this);
		file_2_download = (ImageView) findViewById(R.id.file_2_download);
		file_2_download.setOnClickListener(this);
		file_3_download = (ImageView) findViewById(R.id.file_3_download);
		file_3_download.setOnClickListener(this);
		file_4_dwonload = (ImageView) findViewById(R.id.file_4_dwonload);
		file_4_dwonload.setOnClickListener(this);
		file_5_download = (ImageView) findViewById(R.id.file_5_download);
		file_5_download.setOnClickListener(this);
		file_6_dwonload = (ImageView) findViewById(R.id.file_6_dwonload);
		file_6_dwonload.setOnClickListener(this);
		file_7_download = (ImageView) findViewById(R.id.file_7_download);
		file_7_download.setOnClickListener(this);
		file_8_download = (ImageView) findViewById(R.id.file_8_download);
		file_8_download.setOnClickListener(this);
		file_9_download = (ImageView) findViewById(R.id.file_9_download);
		file_9_download.setOnClickListener(this);
		file_10_download = (ImageView) findViewById(R.id.file_10_download);
		file_10_download.setOnClickListener(this);

		Button view1 = (Button) findViewById(R.id.view1);
		view1.setOnClickListener(this);
		Button view2 = (Button) findViewById(R.id.view2);
		view2.setOnClickListener(this);
		Button view3 = (Button) findViewById(R.id.view3);
		view3.setOnClickListener(this);

		Button view4 = (Button) findViewById(R.id.view4);
		view4.setOnClickListener(this);
		Button view5 = (Button) findViewById(R.id.view5);
		view5.setOnClickListener(this);
		Button view6 = (Button) findViewById(R.id.view6);
		view6.setOnClickListener(this);
		Button view7 = (Button) findViewById(R.id.view7);
		view7.setOnClickListener(this);
		Button view8 = (Button) findViewById(R.id.view8);
		view8.setOnClickListener(this);
		Button view9 = (Button) findViewById(R.id.view9);
		view9.setOnClickListener(this);
		Button view10 = (Button) findViewById(R.id.view10);
		view10.setOnClickListener(this);

		file_1_Vault = (Button) findViewById(R.id.file_1_Vault);
		file_1_Vault.setOnClickListener(this);

		file_2_vault = (Button) findViewById(R.id.file_2_vault);
		file_2_vault.setOnClickListener(this);
		file_3_vault = (Button) findViewById(R.id.file_3_vault);
		file_3_vault.setOnClickListener(this);
		file_4_vault = (Button) findViewById(R.id.file_4_vault);
		file_4_vault.setOnClickListener(this);
		file_5_vault = (Button) findViewById(R.id.file_5_vault);
		file_5_vault.setOnClickListener(this);
		file_6_vault = (Button) findViewById(R.id.file_6_vault);
		file_6_vault.setOnClickListener(this);
		file_7_valut = (Button) findViewById(R.id.file_7_valut);
		file_7_valut.setOnClickListener(this);
		file_8_vault = (Button) findViewById(R.id.file_8_vault);
		file_8_vault.setOnClickListener(this);
		file_9_valut = (Button) findViewById(R.id.file_9_valut);
		file_9_valut.setOnClickListener(this);
		file_10_vault = (Button) findViewById(R.id.file_10_vault);
		file_10_vault.setOnClickListener(this);

		TextView file_1 = (TextView) findViewById(R.id.file_1);

		if (!TextUtils.isEmpty(SecureActivity.getEpackge.getFile_name())) {
			file_1.setVisibility(View.VISIBLE);
			file_1.setText(SecureActivity.getEpackge.getFile_name());

			file_1_Vault.setVisibility(View.VISIBLE);
			file_1_download.setVisibility(View.VISIBLE);
			view1.setVisibility(View.VISIBLE);

		}

		/*
		 * file_1.setOnClickListener(new OnClickListener() {
		 * 
		 * @Override public void onClick(View v) { new User_file().execute("1");
		 * 
		 * } });
		 */

		TextView file_2 = (TextView) findViewById(R.id.file_2);
		if (!TextUtils.isEmpty(SecureActivity.getEpackge.getFile_name2())) {
			file_2.setVisibility(View.VISIBLE);
			file_2.setText(SecureActivity.getEpackge.getFile_name2());
			file_2_vault.setVisibility(View.VISIBLE);
			file_2_download.setVisibility(View.VISIBLE);
			view2.setVisibility(View.VISIBLE);
		}

		/*
		 * file_2.setOnClickListener(new OnClickListener() {
		 * 
		 * @Override public void onClick(View v) { new User_file().execute("2");
		 * 
		 * } });
		 */

		TextView file_3 = (TextView) findViewById(R.id.file_3);
		if (!TextUtils.isEmpty(SecureActivity.getEpackge.getFile_name3())) {
			file_3.setVisibility(View.VISIBLE);
			file_3.setText(SecureActivity.getEpackge.getFile_name3() + "");

			file_3_vault.setVisibility(View.VISIBLE);
			file_3_download.setVisibility(View.VISIBLE);
			view3.setVisibility(View.VISIBLE);

		}

		/*
		 * file_3.setOnClickListener(new OnClickListener() {
		 * 
		 * @Override public void onClick(View v) { new User_file().execute("3");
		 * 
		 * } });
		 */

		TextView file_4 = (TextView) findViewById(R.id.file_4);
		if (!TextUtils.isEmpty(SecureActivity.getEpackge.getFile_name4())) {
			file_4.setVisibility(View.VISIBLE);
			file_4.setText(SecureActivity.getEpackge.getFile_name4() + "");

			file_4_vault.setVisibility(View.VISIBLE);
			file_4_dwonload.setVisibility(View.VISIBLE);
			view4.setVisibility(View.VISIBLE);
		}

		/*
		 * file_4.setOnClickListener(new OnClickListener() {
		 * 
		 * @Override public void onClick(View v) { new User_file().execute("4");
		 * 
		 * } });
		 */

		TextView file_5 = (TextView) findViewById(R.id.file_5);
		if (!TextUtils.isEmpty(SecureActivity.getEpackge.getFile_name5())) {
			file_5.setVisibility(View.VISIBLE);
			file_5.setText(SecureActivity.getEpackge.getFile_name5() + "");

			file_5_vault.setVisibility(View.VISIBLE);
			file_5_download.setVisibility(View.VISIBLE);
			view5.setVisibility(View.VISIBLE);
		}

		/*
		 * file_5.setOnClickListener(new OnClickListener() {
		 * 
		 * @Override public void onClick(View v) { new User_file().execute("5");
		 * 
		 * } });
		 */

		TextView file_6 = (TextView) findViewById(R.id.file_6);
		if (!TextUtils.isEmpty(SecureActivity.getEpackge.getFile_name6())) {
			file_6.setVisibility(View.VISIBLE);
			file_6.setText(SecureActivity.getEpackge.getFile_name6() + "");

			file_6_vault.setVisibility(View.VISIBLE);
			file_6_dwonload.setVisibility(View.VISIBLE);
			view6.setVisibility(View.VISIBLE);
		}

		/*
		 * file_6.setOnClickListener(new OnClickListener() {
		 * 
		 * @Override public void onClick(View v) { new User_file().execute("6");
		 * 
		 * } });
		 */

		TextView file_7 = (TextView) findViewById(R.id.file_7);

		if (!TextUtils.isEmpty(SecureActivity.getEpackge.getFile_name7())) {
			file_7.setVisibility(View.VISIBLE);
			file_7.setText(SecureActivity.getEpackge.getFile_name7() + "");

			file_7_valut.setVisibility(View.VISIBLE);
			file_7_download.setVisibility(View.VISIBLE);
			view7.setVisibility(View.VISIBLE);

		}
		/*
		 * file_7.setOnClickListener(new OnClickListener() {
		 * 
		 * @Override public void onClick(View v) { new User_file().execute("7");
		 * 
		 * } });
		 */
		TextView file_8 = (TextView) findViewById(R.id.file_8);
		if (!TextUtils.isEmpty(SecureActivity.getEpackge.getFile_name8())) {
			file_8.setVisibility(View.VISIBLE);
			file_8.setText(SecureActivity.getEpackge.getFile_name8() + "");

			file_8_vault.setVisibility(View.VISIBLE);
			file_8_download.setVisibility(View.VISIBLE);
			view8.setVisibility(View.VISIBLE);
		}

		/*
		 * file_8.setOnClickListener(new OnClickListener() {
		 * 
		 * @Override public void onClick(View v) { new User_file().execute("8");
		 * 
		 * } });
		 */

		TextView file_9 = (TextView) findViewById(R.id.file_9);
		if (!TextUtils.isEmpty(SecureActivity.getEpackge.getFile_name9())) {
			file_9.setVisibility(View.VISIBLE);
			file_9.setText(SecureActivity.getEpackge.getFile_name9() + "");

			file_9_valut.setVisibility(View.VISIBLE);
			file_9_download.setVisibility(View.VISIBLE);
			view9.setVisibility(View.VISIBLE);

		}

		/*
		 * file_9.setOnClickListener(new OnClickListener() {
		 * 
		 * @Override public void onClick(View v) { new User_file().execute("9");
		 * 
		 * } });
		 */

		TextView file_10 = (TextView) findViewById(R.id.file_10);
		if (!TextUtils.isEmpty(SecureActivity.getEpackge.getFile_name10())) {
			file_10.setVisibility(View.VISIBLE);
			file_10.setText(SecureActivity.getEpackge.getFile_name10() + "");

			file_10_vault.setVisibility(View.VISIBLE);
			file_10_download.setVisibility(View.VISIBLE);
			view10.setVisibility(View.VISIBLE);

		}

		/*
		 * file_10.setOnClickListener(new OnClickListener() {
		 * 
		 * @Override public void onClick(View v) { new
		 * User_file().execute("10");
		 * 
		 * } });
		 */
		/*
		 * TextView file_1 = (TextView) findViewById(R.id.file_1);
		 * 
		 * if(!TextUtils.isEmpty(TabSecure_Activity.getEpackge.getFile_name())){
		 * file_1.setVisibility(View.VISIBLE);
		 * file_1.setText(Html.fromHtml(TabSecure_Activity
		 * .getEpackge.getFile_name())); } TextView file_2 = (TextView)
		 * findViewById(R.id.file_2);
		 * if(!TextUtils.isEmpty(TabSecure_Activity.getEpackge
		 * .getFile_name10())){ file_2.setVisibility(View.VISIBLE);
		 * file_2.setText
		 * (Html.fromHtml(TabSecure_Activity.getEpackge.getFile_name10())); }
		 * TextView file_3 = (TextView) findViewById(R.id.file_3);
		 * if(!TextUtils.
		 * isEmpty(TabSecure_Activity.getEpackge.getFile_name2())){
		 * file_3.setVisibility(View.VISIBLE);
		 * file_3.setText(Html.fromHtml(TabSecure_Activity
		 * .getEpackge.getFile_name2() + "")); }
		 * 
		 * TextView file_4 = (TextView) findViewById(R.id.file_4);
		 * if(!TextUtils.
		 * isEmpty(TabSecure_Activity.getEpackge.getFile_name3())){
		 * file_4.setVisibility(View.VISIBLE);
		 * file_4.setText(Html.fromHtml(TabSecure_Activity
		 * .getEpackge.getFile_name3() + "")); } TextView file_5 = (TextView)
		 * findViewById(R.id.file_5);
		 * if(!TextUtils.isEmpty(TabSecure_Activity.getEpackge
		 * .getFile_name4())){ file_5.setVisibility(View.VISIBLE);
		 * file_5.setText
		 * (Html.fromHtml(TabSecure_Activity.getEpackge.getFile_name4() + ""));
		 * }
		 * 
		 * TextView file_6 = (TextView) findViewById(R.id.file_6);
		 * if(!TextUtils.
		 * isEmpty(TabSecure_Activity.getEpackge.getFile_name5())){
		 * file_6.setVisibility(View.VISIBLE);
		 * file_6.setText(Html.fromHtml(TabSecure_Activity
		 * .getEpackge.getFile_name5() + ""));
		 * 
		 * }
		 * 
		 * TextView file_7 = (TextView) findViewById(R.id.file_7);
		 * 
		 * if(!TextUtils.isEmpty(TabSecure_Activity.getEpackge.getFile_name6())){
		 * file_7.setVisibility(View.VISIBLE);
		 * file_7.setText(Html.fromHtml(TabSecure_Activity
		 * .getEpackge.getFile_name6() + "")); }
		 * 
		 * TextView file_8 = (TextView) findViewById(R.id.file_8);
		 * if(!TextUtils.
		 * isEmpty(TabSecure_Activity.getEpackge.getFile_name7())){
		 * file_8.setVisibility(View.VISIBLE);
		 * file_8.setText(Html.fromHtml(TabSecure_Activity
		 * .getEpackge.getFile_name7() + "")); }
		 * 
		 * TextView file_9 = (TextView) findViewById(R.id.file_9);
		 * if(!TextUtils.
		 * isEmpty(TabSecure_Activity.getEpackge.getFile_name8())){
		 * file_9.setVisibility(View.VISIBLE);
		 * file_9.setText(Html.fromHtml(TabSecure_Activity
		 * .getEpackge.getFile_name8() + "")); }
		 * 
		 * TextView file_10 = (TextView) findViewById(R.id.file_10);
		 * if(!TextUtils
		 * .isEmpty(TabSecure_Activity.getEpackge.getFile_name9())){
		 * file_10.setVisibility(View.VISIBLE);
		 * file_10.setText(Html.fromHtml(TabSecure_Activity
		 * .getEpackge.getFile_name9() + "")); }
		 */
		// System.out.println("Class"+getParent().getClass().getSimpleName());

		pd = new ProgressDialog(
				((SecureActivity) getParent()).getParentActivity());
		pd.setMessage("Loading...");
		// pd.show();

	}

	Handler handler = new Handler() {
		@Override
		public void handleMessage(Message msg) {
			// TODO Auto-generated method stub
			super.handleMessage(msg);
			if (msg.what == 1) {
				pd.show();
			} else {
				pd.dismiss();
			}
		}
	};

	class User_file extends AsyncTask<String, Void, Boolean> {
		boolean result = false;
		// String error_msg = "";
		String Result = null;
		Parser_Soap parse = new Parser_Soap();
		Error_Report repor = new Error_Report();

		@Override
		protected Boolean doInBackground(String... params) {
			Http_Soap_Call call = Http_Soap_Call.create_connection("",
					Attachment.this);
			if (call != null) {
				Result = parse.GetFile(call.GetFile(Utility
						.getStringPreference(Attachment.this, "LoginToken",
								params[0]), SecureActivity.MSG_ID, params[0],
						repor), repor);
				if (Result != null) {
					System.out.println("true");
					if (Result.contains("Password Error")) {
						result = false;
					} else {
						result = true;
					}

				} else {
					// error_msg=Utility.INVALID_USER;
					System.out.println("false");
					result = false;
					repor.setMessage("Internal Error");
				}

			} else {
				repor.setMessage(Utility.NETWORK_ISSUE);
				return false;
			}

			return result;
		}

		@Override
		protected void onPreExecute() {
			/*
			 * pd = ProgressDialog.show(Attachment.this, null,
			 * getString(R.string.loader));
			 */
			handler.sendEmptyMessage(1);
		}

		protected void onPostExecute(Boolean result) {
			// This method runs in the UI thread
			handler.sendEmptyMessage(2);
			// pd.dismiss();
			if (result) {
				// Utility.printLog("Login Responce", "Login successfully");
				// Utility.setStringPreference(getParent(), "LoginToken",
				// Result);
				// new User_GetUserInbox().execute(Password);
				/*
				 * Intent mainIntent = new Intent(Password.this,
				 * TabHome_Activity.class);
				 * Password.this.startActivity(mainIntent);
				 * Password.this.finish();
				 */
				// Toast.makeText(Password.this, "Login token get",
				// Toast.LENGTH_SHORT)
				// .show();
			} else {
				// Utility.printLog("Login Responce", "Login Unsuccessfully");
				// Toast.makeText(Password.this, repor.getMessage(),
				// Toast.LENGTH_SHORT).show();
			}

		}
	}

	class add_Vault extends AsyncTask<String, Void, Boolean> {
		boolean result = false;
		// String error_msg = "";
		String Result = null;
		Parser_Soap parse = new Parser_Soap();
		Error_Report repor = new Error_Report();

		@Override
		protected Boolean doInBackground(String... params) {
			Http_Soap_Call call = Http_Soap_Call.create_connection("",
					Attachment.this);
			if (call != null) {
				Result = parse.CopyFileToVault(call.CopyFileToVault(Utility
						.getStringPreference(Attachment.this, "LoginToken",
								params[0]), SecureActivity.MSG_ID, params[0],
						repor), repor);
				if (Result != null) {
					System.out.println("true");
					if (Result.contains("Password Error")) {
						result = false;
					} else {
						result = true;
					}

				} else {
					// error_msg=Utility.INVALID_USER;
					System.out.println("false");
					result = false;
					repor.setMessage("Internal Error");
				}

			} else {
				repor.setMessage(Utility.NETWORK_ISSUE);
				return false;
			}

			return result;
		}

		@Override
		protected void onPreExecute() {
			/*
			 * pd = ProgressDialog.show(Attachment.this, null,
			 * getString(R.string.loader));
			 */
			handler.sendEmptyMessage(1);
		}

		protected void onPostExecute(Boolean result) {
			// This method runs in the UI thread
			handler.sendEmptyMessage(2);
			// pd.dismiss();
			if (result) {

				try {
					JSONObject jsonObj = new JSONObject(Result);

					if (jsonObj.getString("ReturnValue") != null) {
						Toast.makeText(Attachment.this,
								jsonObj.getString("ReturnValue"),
								Toast.LENGTH_SHORT).show();
					} else {
						Toast.makeText(Attachment.this,
								jsonObj.getString("ReturnValue"),
								Toast.LENGTH_SHORT).show();
					}

				} catch (Exception e) {
					e.printStackTrace();
				}

				// Utility.printLog("Login Responce", "Login successfully");
				// Utility.setStringPreference(getParent(), "LoginToken",
				// Result);
				// new User_GetUserInbox().execute(Password);
				/*
				 * Intent mainIntent = new Intent(Password.this,
				 * TabHome_Activity.class);
				 * Password.this.startActivity(mainIntent);
				 * Password.this.finish();
				 */
				// Toast.makeText(Password.this, "Login token get",
				// Toast.LENGTH_SHORT)
				// .show();
			} else {
				// Utility.printLog("Login Responce", "Login Unsuccessfully");
				// Toast.makeText(Password.this, repor.getMessage(),
				// Toast.LENGTH_SHORT).show();
			}

		}
	}

	class GetWebInterfaceURL extends AsyncTask<String, Void, Boolean> {
		boolean result = false;
		// String error_msg = "";
		String Result = null;
		Parser_Soap parse = new Parser_Soap();
		Error_Report repor = new Error_Report();

		@Override
		protected Boolean doInBackground(String... params) {
			Http_Soap_Call call = Http_Soap_Call.create_connection("",
					Attachment.this);
			if (call != null) {
				Result = parse.GetWebInterfaceURL(call.GetWebInterfaceURL(
						Utility.getStringPreference(Attachment.this,
								"LoginToken", params[0]), "view",
						SecureActivity.MSG_ID, params[0], repor), repor);

				if (Result != null) {
					System.out.println("true");
					if (Result.contains("Password Error")) {
						result = false;
					} else {
						result = true;
					}

				} else {
					// error_msg=Utility.INVALID_USER;
					System.out.println("false");
					result = false;
					repor.setMessage("Internal Error");
				}

			} else {
				repor.setMessage(Utility.NETWORK_ISSUE);
				return false;
			}

			return result;
		}

		@Override
		protected void onPreExecute() {

			handler.sendEmptyMessage(1);
		}

		protected void onPostExecute(Boolean result) {
			// This method runs in the UI thread
			handler.sendEmptyMessage(2);
			// pd.dismiss();
			if (result) {
				// Utility.printLog("Login Responce", "Login successfully");
				// Utility.setStringPreference(getParent(), "LoginToken",
				// Result);
				// new User_GetUserInbox().execute(Password);
				/*
				 * Intent mainIntent = new Intent(Password.this,
				 * TabHome_Activity.class);
				 * Password.this.startActivity(mainIntent);
				 * Password.this.finish();
				 */
				// Toast.makeText(Password.this, "Login token get",
				// Toast.LENGTH_SHORT)
				// .show();

				parseWebInfo(Result);

			} else {
				// Utility.printLog("Login Responce", "Login Unsuccessfully");
				// Toast.makeText(Password.this, repor.getMessage(),
				// Toast.LENGTH_SHORT).show();
			}

		}
	}

	@Override
	protected void onStop() {
		// TODO Auto-generated method stub
		System.out.println("Stop");
		super.onStop();
	}

	public void parseWebInfo(String result) {
		try {
			JSONObject onj = new JSONObject(result);

			System.out.println("WEBINFO" + onj.getString("ReturnValue"));
			if (onj.getString("ReturnValue").startsWith("http")) {
				Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(onj
						.getString("ReturnValue")));
				startActivity(i);
			}

		} catch (Exception e) {
			// TODO: handle exception
		}

	}

	@Override
	protected void onDestroy() {
		// TODO Auto-generated method stub
		System.out.println("Ondestroy");
		super.onDestroy();

	}

	public void onClick(View v) {
		int id = v.getId();
		if (id == R.id.file_1_Vault) {
			new add_Vault().execute("1");
		} else if (id == R.id.file_2_vault) {
			new add_Vault().execute("2");
		} else if (id == R.id.file_3_vault) {
			new add_Vault().execute("3");
		} else if (id == R.id.file_4_vault) {
			new add_Vault().execute("4");
		} else if (id == R.id.file_5_vault) {
			new add_Vault().execute("5");
		} else if (id == R.id.file_6_vault) {
			new add_Vault().execute("6");
		} else if (id == R.id.file_7_valut) {
			new add_Vault().execute("7");
		} else if (id == R.id.file_8_vault) {
			new add_Vault().execute("8");
		} else if (id == R.id.file_9_valut) {
			new add_Vault().execute("9");
		} else if (id == R.id.file_10_vault) {
			new add_Vault().execute("10");
		} else if (id == R.id.file_1_download) {
			new User_file().execute("1");
		} else if (id == R.id.file_2_download) {
			new User_file().execute("2");
		} else if (id == R.id.file_3_download) {
			new User_file().execute("3");
		} else if (id == R.id.file_4_dwonload) {
			new User_file().execute("4");
		} else if (id == R.id.file_5_download) {
			new User_file().execute("5");
		} else if (id == R.id.file_6_dwonload) {
			new User_file().execute("6");
		} else if (id == R.id.file_7_download) {
			new User_file().execute("7");
		} else if (id == R.id.file_8_download) {
			new User_file().execute("8");
		} else if (id == R.id.file_9_download) {
			new User_file().execute("9");
		} else if (id == R.id.file_10_download) {
			new User_file().execute("10");
		} else if (id == R.id.view1) {
			new GetWebInterfaceURL().execute("1");
		} else if (id == R.id.view2) {
			new GetWebInterfaceURL().execute("2");
		} else if (id == R.id.view3) {
			new GetWebInterfaceURL().execute("3");
		} else if (id == R.id.view4) {
			new GetWebInterfaceURL().execute("4");
		} else if (id == R.id.view5) {
			new GetWebInterfaceURL().execute("5");
		} else if (id == R.id.view6) {
			new GetWebInterfaceURL().execute("6");
		} else if (id == R.id.view7) {
			new GetWebInterfaceURL().execute("7");
		} else if (id == R.id.view8) {
			new GetWebInterfaceURL().execute("8");
		} else if (id == R.id.view9) {
			new GetWebInterfaceURL().execute("9");
		} else if (id == R.id.view10) {
			new GetWebInterfaceURL().execute("10");
		} else {
		}

	}
}
